<template>
 <div>
  御剑乘风来,除魔天地间!==father==={{app}}
  <Son2></Son2>
 </div>
</template>
<script>
import Son2 from './Son2.vue'
export default{
  provide(){return{
    ff:'我是第一代father',
    app:this.app,
    //儿子要想改变父亲的值,得父亲同时传递一个函数如say
    say:this.handel}},
  inject:['app'],
  components:{Son2},
    name:'',
    data () {
        return {
          app:'我是爸爸我要向儿子传值'
            
        }
    },
    created () {
    },
    computed:{
    },
    methods:{
      handel(msg){
        console.log('handel')
        this.app=msg
      }

    }
}
</script>
<style lang='less'  scoped>
    
</style>
